<script>
import 'animate.css'
export default {
  name: "Test",
  data() {
    return {
      isShow: true
    }
  }
}
</script>

<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition-group name="t2" appear>
      <h1 v-show="isShow" key="1">你好啊！</h1>
      <h1 v-show="!isShow" key="2">你好啊2！</h1>
    </transition-group>

    <div style="width: 1000px; height:10px;background-color: skyblue"></div>
    <transition-group
        name="animate__animated animate__bounce"
        enter-active-class="animate__swing"
        appear
    >
      <h1 v-show="isShow" key="1">你好啊！animate</h1>
      <h1 v-show="!isShow" key="2">你好啊2！animate</h1>
    </transition-group>
  </div>
</template>

<style scoped>
h1 {
  background-color: orange;
}
/*进入的起点*/ /*离开的终点*/
.t2-enter,.t2-leave-to {
  transform: translateX(-100%);
}
/*进入的终点*/ /*离开的起点*/
.t2-enter-to,.t2-leave{
  transform: translateX(0);
}
.t2-enter-active,.t2-leave-active {
  transition: 1s ease;
}
</style>